<%@page import="com.tubeonfire.model.admin.AdvertisingModel"%>
<%@page import="com.tubeonfire.entity.Playlist"%>
<%@page import="com.tubeonfire.model.PlaylistModel"%>
<%@page import="com.tubeonfire.entity.Channel"%>
<%@page import="com.tubeonfire.model.ChannelModel"%>
<%@page import="com.tubeonfire.model.admin.SiteConfigModel"%>
<%@page import="com.tubeonfire.entity.SiteConfig"%>
<%@page import="com.tubeonfire.entity.Advertising"%>
<%@page import="com.google.appengine.api.blobstore.BlobKey"%>
<%@page import="com.google.appengine.api.images.ImagesServiceFactory"%>
<%@page import="com.google.appengine.api.images.ImagesService"%>
<%@page import="java.util.TreeMap"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%	
	SiteConfig siteConfig = SiteConfigModel.get();	
%>
<jsp:include page="/admin/elements/header.jsp">
	<jsp:param value="Advertising Manager" name="title"/>
</jsp:include>
<script type="text/javascript" src="/admin/js/mine/admin.js"></script>
<script type="text/javascript" src="/admin/js/mine/advertising_choose.js"></script>
	<body class="loggedin">
		<jsp:include page="/admin/elements/top.jsp"/>
	    <!-- START OF MAIN CONTENT -->
	    <div class="mainwrapper">
	     	<div class="mainwrapperinner">         	        
				<jsp:include page="/admin/elements/left.jsp">
					<jsp:param value="advertising" name="current_page"/>
				</jsp:include>					              	                   
	        	<div class="maincontent noright">
	        		<div class="maincontentinner">	            	
		                <ul class="maintabmenu">		                	
		                	<li><a href="/admin/advertising/manage?place=1">Home</a></li>
		                	<li class="current"><a href="/admin/advertising/manage?place=2">Detail</a></li>
		                	<li><a href="/admin/advertising/manage?place=3">Newest & Most View</a></li>
		                	<li><a href="/admin/advertising/manage?place=4">Playlist</a></li>
		                	<li><a href="/admin/advertising/manage?place=5">Channel</a></li>
		                	<li><a href="/admin/advertising/manage?place=6">Search & Tag</a></li>
		                	<li><a href="/admin/advertising/manage?place=7">All Playlist</a></li>
		                	<li><a href="/admin/advertising/manage?place=8">All Channel</a></li>	
		                </ul><!--maintabmenu-->	                
	                	<div class="content">	
	                	<div class="notification msginfo">		
	                		<a class="close"></a>				   
						    <p>Note : Only 3 Google Adsense Block can be added in one page. 4th advertising block will not be displayed.</p>
						</div>	 
	                	<jsp:include page="/admin/elements/message.jsp"/>
	                	<div id="messageDiv" class="notification hidden">						   
						    <p></p>
						</div>	   	                    
	                    	<div class="contenttitle">
	                    		<h2 class="image"><span>Choose Place To Add Advertising</span></h2>
	                    	</div>
	                    	<br />
		                    <section id="webLayout" class="videoDetail clearafter">						    	
						            
					            <!-- slideshow -->
					            <img alt="" src="/admin/images/detail-video.jpg" width="100%">
					            
					            <!-- content - left side -->
					            <div class="left">
					            <div class="advWrap adv-468x60">
			            			<div>
				            				<%
							                	Advertising ads = AdvertisingModel.getByPlaceAndPosition(2, 1);									                
						            			if(ads!=null){
						            				%>
						            				<%=ads.getType()==1?"Google Adsense":"Advertising" %> Added&nbsp;
					            					<a href="/admin/advertising/edit?id=<%=ads.getId() %>" title="Edit Advertising">(Edit)</a>
					            					<a href="<%=ads.getId() %>" title="Remove Advertising" class="btnRemove">(Remove)</a>
						            				<%
						            			}else{
						            				%>
						            				<a href="/admin/advertising/add?place=2&position=1" title="Add Advertising">(468x60) Click To Add Advertising</a>	
						            				<%
						            			}
						            		%>					            			
					            		</div>
			            			</div>
					            	<img alt="" src="/admin/images/video-description.jpg" width="100%">
					            	<div class="advWrap adv-468x60">
				            			<div>
				            				<%
							                	ads = AdvertisingModel.getByPlaceAndPosition(2, 2);									                
						            			if(ads!=null){
						            				%>
						            				<%=ads.getType()==1?"Google Adsense":"Advertising" %> Added&nbsp;
					            					<a href="/admin/advertising/edit?id=<%=ads.getId() %>" title="Edit Advertising">(Edit)</a>
					            					<a href="<%=ads.getId() %>" title="Remove Advertising" class="btnRemove">(Remove)</a>
						            				<%
						            			}else{
						            				%>
						            				<a href="/admin/advertising/add?place=2&position=2" title="Add Advertising">(468x60) Click To Add Advertising</a>	
						            				<%
						            			}
						            		%>					            			
					            		</div>
			            			</div>
					            	<img alt="" src="/admin/images/video-tags.jpg" width="100%">
					            	<div class="advWrap adv-468x60">
				            			<div>
					            			<%
							                	ads = AdvertisingModel.getByPlaceAndPosition(2, 3);									                
						            			if(ads!=null){
						            				%>
						            				<%=ads.getType()==1?"Google Adsense":"Advertising" %> Added&nbsp;
					            					<a href="/admin/advertising/edit?id=<%=ads.getId() %>" title="Edit Advertising">(Edit)</a>
					            					<a href="<%=ads.getId() %>" title="Remove Advertising" class="btnRemove">(Remove)</a>
						            				<%
						            			}else{
						            				%>
						            				<a href="/admin/advertising/add?place=2&position=3" title="Add Advertising">(468x60) Click To Add Advertising</a>	
						            				<%
						            			}
						            		%>
					            		</div>
			            			</div>
					            	<img alt="" src="/admin/images/video-othertags.jpg" width="100%">
					            	<div class="advWrap adv-468x60">
				            			<div>
					            			<%
							                	ads = AdvertisingModel.getByPlaceAndPosition(2, 4);									                
						            			if(ads!=null){
						            				%>
						            				<%=ads.getType()==1?"Google Adsense":"Advertising" %> Added&nbsp;
					            					<a href="/admin/advertising/edit?id=<%=ads.getId() %>" title="Edit Advertising">(Edit)</a>
					            					<a href="<%=ads.getId() %>" title="Remove Advertising" class="btnRemove">(Remove)</a>
						            				<%
						            			}else{
						            				%>
						            				<a href="/admin/advertising/add?place=2&position=4" title="Add Advertising">(468x60) Click To Add Advertising</a>	
						            				<%
						            			}
						            		%>
					            		</div>
			            			</div>
					            </div>
					            
					            <!-- content - right side -->
					            <div class="right">
									<img alt="" src="/admin/images/video-comment.jpg" width="100%">
									<div class="advWrap adv-336x280">
				            			<div>
					            			<%
							                	ads = AdvertisingModel.getByPlaceAndPosition(2, 5);									                
						            			if(ads!=null){
						            				%>
						            				<%=ads.getType()==1?"Google Adsense":"Advertising" %> Added&nbsp;
					            					<a href="/admin/advertising/edit?id=<%=ads.getId() %>" title="Edit Advertising">(Edit)</a>
					            					<a href="<%=ads.getId() %>" title="Remove Advertising" class="btnRemove">(Remove)</a>
						            				<%
						            			}else{
						            				%>
						            				<a href="/admin/advertising/add?place=2&position=5" title="Add Advertising">(336x280) Click To Add Advertising</a>	
						            				<%
						            			}
						            		%>
					            		</div>
			            			</div>
					            </div>
					            
					            <!-- footer -->
					            <img alt="" src="/admin/images/footer.jpg" width="100%">
						    </section>   
	                    <br /><br />	                    
	                </div><!--content-->	                
	            </div><!--maincontentinner-->
				<jsp:include page="/admin/elements/bottom.jsp"></jsp:include>                    	           	
	        </div><!--maincontent-->	                        
	     	</div><!--mainwrapperinner-->
	    </div><!--mainwrapper-->
		<!-- END OF MAIN CONTENT -->    
	</body>
</html>
